package com.cjx.minio.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.*;
import org.springframework.format.annotation.DateTimeFormat;


import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.Date;

/**
 * FileManagementEntity: 数据对象
 *
 * @author : cjunxian
 * @since 2020-09-24
 * @version 1.0
 */
@Data
@EqualsAndHashCode(callSuper = false)
@ToString
@NoArgsConstructor
@AllArgsConstructor
@Table(name = "file_management")
@Entity
public class FileManagementEntity implements Serializable {

  /** 序列化版本 UID. */
  private static final long serialVersionUID = 1L;
  /** 主键 */

  @Id
  @Column(name = "file_id")
  private String fileId;
  /** 文件名称 */
  @Column(name = "file_name")
  private String fileName;
  /** 文件类型 */
  @Column(name = "file_type")
  private String fileType;
  /** 文件大小 */
  @Column(name = "file_size")
  private String fileSize;
  /** 是否需要预览: 0->不可以预览; 1->可以预览 */
  @Column(name = "is_need_preview")
  private Long isNeedPreview;
  /** 文件相对路径 */
  @Column(name = "relative_path")
  private String relativePath;
  /** 记录创建人 */
  @Column(name = "creator")
  private String creator;
  /** 记录创建时间 */
  @Column(name = "create_time")
  @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
  @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  private Date createTime;
}
